/**
 * 
 */
package bpel.instructions;

import java.util.LinkedList;

import bpel.BPELProcess;

/**
 * @author Maurice & Topia
 * 
 */
public class BPELSwitch extends BPELInstruction {
	private LinkedList<BPELCase> cases;

	public BPELSwitch() {
		cases = new LinkedList<BPELCase>();
	}

	public void addCase(BPELCase c) {
		cases.add(c);
	}

	@Override
	public String toString() {
		String switchStr = "Switch{\n";

		for (BPELCase c : cases) {
			switchStr += c.toString() + "\n";
		}

		switchStr += "}";

		return switchStr;
	}

	@Override
	public String execute(BPELProcess process) {
		for(BPELCase c : cases){
			c.execute(process);
		}
		
		return null;
	}
}
